﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BT_web__nhom06
{
    public partial class ChiTiet_User : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string username = Request.QueryString["Username"];
                if (username != null)
                {
                    DataTable tbl = Tienichsql.ketnoicsdl.ChayLenhSelectDuLieu("SELECT * FROM [User] where username=@username", "@username", username);
                      if (tbl.Rows.Count > 0)
                    {
                        DataRow dr = tbl.Rows[0];
                        lblusername.Text = dr["Username"].ToString();
                        lblpassword.Text = dr["Password"].ToString();
                        lblmasv.Text = dr["MaHS"].ToString();
                        bool khoa = (bool)dr["Locked"];
                        if (khoa) lblkhoa.Text = "Khóa";
                        else lblkhoa.Text = "Chưa Khóa";
                        lblthoidiemdncuoi.Text = dr["ThoidiemDangNhapCuoi"].ToString();
                        lblip.Text = dr["IPMayDangNhapCuoi"].ToString();
                        lblmac.Text = dr["MACMayDangNhapCuoi"].ToString();
                        lblquyen.Text = dr["Quyen"].ToString();
                    }

                }
            }
            else
                    Response.Redirect("QuanLyTaiKhoan.aspx");
            }
        }
    }